Skip to content

feat(settings): selectable primary display currency (#63)#71

Open
Zillatron27 wants to merge 1 commit into
mainfrom
feat/currency-override
Open

feat(settings): selectable primary display currency (#63)#71
Zillatron27 wants to merge 1 commit into
mainfrom
feat/currency-override

Conversation

@Zillatron27

Copy link
Copy Markdown
Owner

Summary

First PR of the action-passthrough wave. The liquidity pane's headline currency was always derived from the company's faction (countryId GUID → COUNTRY_CURRENCY); players who trade mainly in a non-faction currency saw the wrong headline. This adds a user override:

  • settings.preferredCurrency: string | null — default null keeps the faction-derived behaviour exactly as before (persist merge handles the new top-level key for existing users).
  • lib/currency.ts gains resolvePrimaryCurrency(countryId, override) — override wins, else faction lookup. All currency logic stays in the one pure module.
  • CashBalancePane resolves through it (settings value added to the memo deps).
  • Settings gets a Primary Currency panel — Auto | AIC | CIS | ICA | NCC button group (PrUn's currency set is fixed; ECD stays excluded as before).

Closes #63.

Testing

  • 586 tests pass (+6): resolvePrimaryCurrency override/fallback/no-company/null cases; settings default-null + setter round-trip.
  • npx tsc --noEmit clean; Chrome + Firefox builds green.

🤖 Generated with Claude Code

The liquidity pane's headline currency was always derived from the
company's faction, but players often trade mainly in a non-faction
currency based on where they operate. New settings.preferredCurrency
(default null = faction-derived, unchanged behaviour) overrides it via
resolvePrimaryCurrency(); Settings gains a Primary Currency picker
(Auto | AIC | CIS | ICA | NCC) using the established button-group idiom.

Closes #63.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
apxm 355e139 Jul 06 2026, 10:56 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selectable displayed primary currency

1 participant